<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的订单</title>
    <link rel="stylesheet" href="/stylesheets/personnal.css">
    <link rel="stylesheet" href="/stylesheets/xiuxiu.css">
</head>
<body>
<!--导航-->
<%include nav.html%>
<div class="personnal_container">
    <!--左边内容-->
    <div class="person_left">
        <div class="left_icon">
            <img src="/images/dog_icon.png" alt="" style="width: 120px;height: 120px">
        </div>
        <ul>
            <a href="/users"><li>查看用户信息</li></a>
            <a href="/users/apply_foster"><li>申请寄养家庭</li></a>
            <a href="/users/mypet"> <li>我的宠物</li></a>
            <a href="/users/collection"> <li>宠物故事</li></a>
            <a href="/users/myorder"><li class="bgcolor">我的订单</li></a>
        </ul>
    </div>
    <!--右边订单-->
    <div class="person_right">
        <div class="editor_container">
            <div class="editor_header">
                <h3>订单列表</h3>
            </div>
            <div class="myorder-container scrollbar">
                <%
                for(var i in order){
                %>
                <form  class="del-order"  role="form" method="post" id="del_order">
                    <!--<div class="order_list_con" id="order_show">-->
                    <div class="order_list">
                        <div class="order_header" style="overflow: hidden">
                            <div class="bussiness_order">订单号：
                                <input type="text" value="<%=order[i].orderno%>" name="orderno">
                                <input type="text" value="<%=order[i].needsno%>" hidden name="needsno"><br>
                            </div>
                            <div class="bussiness_order">交易时间:<%=order[i].dealdate%></div>
                            <div class="bussiness_order"><input type="submit" value="删除" class="default"></div>
                        </div>
                        <div class="order_service">
                            <div class="order_service_list">商品图片</div>
                            <div class="order_service_list">商家名称</div>
                            <div class="order_service_list">价格</div>
                            <div class="order_service_list">小计</div>
                        </div>
                        <div class="order_service">
                            <div class="order_service_list"><img src="/pets/<%=order[i].varietieno%>.jpg" alt=""></div>
                            <div class="order_service_list"><%=order[i].shop_name%></div>
                            <div class="order_service_list"><%=order[i].price%>元</div>
                            <div class="order_service_list"><%=order[i].price%>元</div>
                        </div>
                    </div>
                    <!--</div>-->
                </form>

                <%
                }
                %>
            </div>

        </div>
    </div>
</div>
<%include footer.html%>
<!--<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>-->
<script src="/js/jquery-1.8.3.js"></script>
<script>
    $('#del_order').submit(function () {
        $.ajax({
            type: 'POST',
            url: '/order/del',
            data:$(this).serialize(),
            dataType:'json',
            success: function (data) {
                if(data.res=="1"){
                    location.href='/users/myorder';
                }
            },
            error: function (data) {
                alert(data);
            }
        });
        return false;
    })
</script>
</body>
</html>